#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;

void solve() {
	string s;
	cin >> s;
	int ans = 0;
	int flag = 1;
	for (int i = 0; i < s.size() - 1; ++i) {
		if (s[i] == '-')	continue;
		ans = ans + (s[i] - '0') * flag;
		flag++;
	}
	//cout << "ans:" << ans << endl;
	if (ans % 11 == 10 && s[s.size() - 1] == 'X') {
		cout << "Right";
		return;
	}
		

	if (ans % 11 == (s[s.size() - 1] - '0')) {
		cout << "Right";
		return;
	}
		

	for (int i = 0; i < s.size() - 1; ++i) {
		cout << s[i];
	}
	if (ans % 11 == 10)
		cout << 'X';
	else
		cout << ans % 11;

	return;
}

int main() {
	solve();
	return 0;
}



/*
int main() {
	int a[3];
	for (int i = 0; i <= 2; ++i) cin >> a[i];
	sort(a, a + 3);
	string s;
	cin >> s;
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] == 'A')
			cout << a[0] << " ";
		if (s[i] == 'B')
			cout << a[1] << " ";
		if (s[i] == 'C')
			cout << a[2] << " ";
	}
	return 0;
}
*/


/*
int main() {
	int a[10];
	int x;
	
	int ans = 0;
	for (int i = 0; i < 10; ++i) 
		cin >> a[i];
	
	cin >> x;
	for (int i = 0; i < 10; ++i) {		
		if (x + 30 >= a[i])
			ans++;
	}
	cout << ans;


	return 0;
}
*/

/*
int gcd(int a, int b) {
	return a > 0 ? gcd(b % a, a) : b;
}


int main() {
	int a[3];
	
	for (int i = 0; i <= 2; ++i) {
		cin >> a[i];
	}
	sort(a, a + 3);

	cout << a[0] / gcd(a[0], a[2]);
	cout << "/";
	cout << a[2] / gcd(a[0], a[2]);


	return 0;
}
*/


/*
int main() {
	int a[7] = { 250,250,250,250,250,0,0 };
	long long  ans = 0;
	int x, n;
	cin >> x >> n;
	for (int i = x-1; i <= x+n-2; ++i) {
		ans = ans + a[(i % 7)];
	}
	cout << ans;

	return 0;
}
*/


/*
double ans = 0;
void solve(int temp) {
	if (temp <= 150) {
		ans = temp * 0.4463;
		printf("%.1f", ans);		
	}
	if (temp > 150 && temp <= 400) {
		ans = 150*0.4463 + (temp - 150) * 0.4663;
		printf("%.1f", ans);
	}
	if (temp > 400) {
		ans = 150 * 0.4463 + 250 * 0.4663 + (temp - 400) * 0.5663;
		printf("%.1f", ans);		
	}
	return;
}



int main() {

	int x;
	cin >> x;
	
	solve(x);
	return 0;
}
*/


/*
int paixu[3];
int a, b, c;
void solve() {

	paixu[0] = a;
	paixu[1] = b;
	paixu[2] = c;
	sort(paixu, paixu + 3);
	if (paixu[0] + paixu[1] <= paixu[2]) {
		cout << "Not triangle";
		return;
	}
	if (paixu[0] * paixu[0] + paixu[1] * paixu[1] < paixu[2] * paixu[2])
		cout << "Obtuse triangle" << '\n';

	if (paixu[0] * paixu[0] + paixu[1] * paixu[1] == paixu[2] * paixu[2])
		cout << "Right triangle" << '\n';

	if (paixu[0] * paixu[0] + paixu[1] * paixu[1] > paixu[2] * paixu[2])
		cout << "Acute triangle" << '\n';

	if (a == b || b == c || a == c) {
		cout << "Isosceles triangle" << '\n';
	}
	if (a == b && b == c) {
		cout << "Equilateral triangle" << '\n';
	}

	return;
}


int main() {

	cin >> a >> b >> c;
	solve();

	return 0;
}
*/


/*
int m[3], p[3];
int main() {
	int n;
	cin >> n;
	for (int i = 0; i <= 2; ++i) {
		cin >> m[i] >> p[i];
	}
	int ans = 1e9;
	for (int i = 0; i <= 2; ++i) {
		int trp = n / m[i];
		int temp = n % m[i];
		if(temp != 0)
			trp +=1;
		ans = min(ans,trp * p[i]);

	}
	cout << ans;
	return 0;
}
*/